<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>药品助手</title> 
<meta name="viewport"
	content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./css/jquery.mobile-1.4.6.min.css" />
<script src="./js/jquery.js"></script>
<script src="./js/jquery.mobile-1.4.5.min.js"></script>
<style type="text/css">
body{
	margin: 0 auto;
	padding: 0 auto;
	background-color: #f2f8f8;
}
.center{
	margin:0 auto;
	margin-top:16px;
}
</style>
<script type="text/javascript">
 function OnInput (event) {
 			if(event.target.value!=null && event.target.value!=""){
 				document.getElementById("del").style.display="";
 			}else{
 				document.getElementById("del").style.display="none";
 			}
        }
        function OnPropChanged (event) {
            if (event.propertyName.toLowerCase () == "value") {
            	if(event.srcElement.value!=null && event.srcElement.value!=""){
            		document.getElementById("del").style.display="";
            	}else{
 				document.getElementById("del").style.display="none";
 			}
            }
        }
function setWidth(){
	if(document.getElementById("seach").value==null || document.getElementById("seach").value==""){
		document.getElementById("del").style.display="none";
	}else{
		document.getElementById("del").style.display="";
	}
	var Module=window.sessionStorage.getItem("Module").toString();
	if("01"==Module){
		document.getElementById("medicinalId").style.display="none";
	}else if("02"==Module){
		document.getElementById("newsId").style.display="none";
	}
}
function toNews(){
	/* window.open("news.html","_blank"); */
	location.href="news.html";
}
function toMedicinaltype(){
	location.href="medicinaltype.html";
}
function toSeach(){
	if(document.getElementById("seach").value==null || ""==document.getElementById("seach").value){
		document.getElementById("msg").innerHTML="<font color=red>请输入要发送的消息</font>";
		return;
	}
	var radio1=document.getElementById("radio1").value;
	var radio2=document.getElementById("radio2").value;
    var content=document.getElementById("seach").value;
    var phone=document.getElementById("phone").value;
	document.getElementById("form1").submit();
}

function radio(val){
if(val==1){
document.getElementById("radio2").checked="";
document.getElementById("radio2").value="";
document.getElementById("radio1").value=val;
document.getElementById("phone").style.visibility="visible";
}else{
document.getElementById("radio1").checked="";
document.getElementById("radio1").value="";
document.getElementById("radio2").value=val;
document.getElementById("phone").style.visibility="hidden";
}
}
</script>
</head>

<body onload="setWidth();">
 <form id="form1" name="form1" method="post" action="Controler.do?action=sendMsg">  
	<div data-role="page" style="background-color: #f2f8f8;">
			<div style="position:relative;margin-top:16px;">
				<input id="seach" name="seach" placeholder="请输入要发送的消息" type="text" style="background-color: #ffffff;width:100%;height:100px;padding:10px;top:0px;algin:top;">
			</div>
			<div style="position:relative;margin-top:16px;">
			<div>
			<label><input id="radio2" name="radio2" type="radio" value="" onclick="radio(2)" />给所有用户发送推送消息和短信</label>
			<br/>
			<label><input id="radio1" name="radio1" type="radio" value=""  onclick="radio(1)" />指定用户发送推送消息和短信 </label><br/><input id="phone" name="phone" placeholder="请输入指定的手机号" type="text" style="background-color: #ffffff;width:80%;padding:10px;top:0px;algin:top;">
			</div>
			</div>
			<div class="center">
				<div id="msg" style="margin:10px;"></div>
				<button  id="clearBtn" onclick="toSeach();"  type="button"  style="margin:auto;width: 100%;background-color: #4db6ac;border:none;padding: 10px;font-size: 16px;color: white;font-weight:bolder;">发送</button>
			</div>
	</div>
	</form>  
</body>
</html>
